import fizzBuzzConverter from "../../src/fizzBuzzConverter";

type ResultType = string | number;

export const testTemplate: (
  strs: TemplateStringsArray,
  ...args: ResultType[]
) => void = (strs, ...rest) => {
  const message =
    rest.map((item, index) => `${strs[index]}${item}`).join("") +
    strs.slice(rest.length).join("");

  test(message, () => {
    expect(fizzBuzzConverter(rest[1] as number)).toBe(rest[0]);
  });
};
